$.each($(".modal-body .tabs").children(),function(){
	$(this).click(function(){
		var index = $(this).attr("id");
		$(".tabs li.active").removeClass("active");
		$(this).addClass("active");
		$(".modal-body .tab-body").addClass("hidden");
		$(".modal-body .tab-body[id="+index+"]").removeClass("hidden");
	});
}); 
function init_origin(){
	var pField = document.getElementById("userProvince");
	var cField = document.getElementById("userCity");
	var province = "广东";
	var city = "深圳";
	init_province_and_city(pField, province, cField, city);
}  
 
$(document).ready(function(e){
	var uploader = new qq.FileUploader({ 
	    element: $('#file-uploader')[0], 
	    action: '/upload', 
	    allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
	    onComplete: function(id, filename,resp){
	    	if(resp.success=='true'){   
	    		$("#upload-container .upload").hide();  
	    		$("#upload-container .upload-image").html('<img id="imgArea" src="'+resp.url+'"></img>'); 
	    		$("#imgArea").imgAreaSelect({
	    	        handles: true, 
	    	        x1:100,y1:100,x2:228,y2:228,
	    	        aspectRatio: "1:1",
	    	        parent: '#upload-container .upload-image'
	    	    }); 
	    		if( $("#file-uploader").parent().parent().attr("id") == "upload-container" ){
	    			var upload = $("#file-uploader").removeClass(".upload-btn2").addClass("upload-btn"); 
	    			$("#upload-footer").append(upload);
	    		}
	    		
	    	} 
	    }
	}); 
});